package com.example.game.entity;

import java.awt.*;

public class Bullet {
    private int x;
    private int y;
    private int speed = 10;
    private boolean facingRight;
    private static final int SIZE = 5;
    
    public Bullet(int x, int y, boolean facingRight) {
        this.x = x;
        this.y = y;
        this.facingRight = facingRight;
    }
    
    public void update() {
        if (facingRight) {
            x += speed;
        } else {
            x -= speed;
        }
    }
    
    public void draw(Graphics g) {
        g.setColor(Color.RED);
        g.fillOval(x, y, SIZE, SIZE);
    }
    
    public Rectangle getBounds() {
        return new Rectangle(x, y, SIZE, SIZE);
    }
    
    public boolean isOffScreen(int screenWidth) {
        return x < 0 || x > screenWidth;
    }
}
